package com.yanqu.road.server.cmd.banquet.auto;


import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.banquet.CrossBanquetProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.banquet.CrossBanquetAutoMgr;
import com.yanqu.road.server.protocol.Protocol;


@Cmd(code = Protocol.C_CROSS_BANQUET_AUTO_ADD_POPULARITY, desc = "")
public class BanquetAutoAddPopCmd extends CrossCommand {


    private long userId;
    private CrossBanquetProto.CrossAddAutoBanquetPopRewardReq reqMsg;


    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        reqMsg = CrossBanquetProto.CrossAddAutoBanquetPopRewardReq.parseFrom(packet.getBytes());
        userId = packet.getPlayerId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossBanquetAutoMgr.addUserPopularity(reqMsg.getAcId(),serverId,reqMsg.getUserId());
    }

    @Override
    public void sendData() {

    }
}
